package com.steven.generic;

public class GenericDemo {
	public static void main(String[] args) 
	{
		
		
//		int i = 42;
//		String s = (i<40)?"life":(i>50)?"universe":"everything";
//		System.out.println(s);

		Demo <String> d = new Demo<String>();
		d.show("haha");
		//d.show(4);
		d.print(5);
		d.print("hehe");

		Demo.method("hahahahha");

		/*
		Demo d = new Demo();
		d.show("haha");
		d.show(new Integer(4));
		d.print("heihei");
		*/
		/*
		Demo<Integer> d = new Demo<Integer>();

		d.show(new Integer(4));
		d.print("hah");

		Demo<String> d1 = new Demo<String>();
		d1.print("haha");
		d1.show(5);
		*/
	}
}
class Demo<T>
{
	public  void show(T t)
	{
		System.out.println("show:"+t);
	}
	public  <Q> void  print(Q q)
	{
		System.out.println("print:"+q);
		 
	}
	public  static <W> void method(W t)
	{
		System.out.println("method:"+t);
	}
}